- /* scfclog.cpp by K.Tsuru */
- // function ID = 9108
- /*************************************************
- SComplex class log(z)
- Let z = x+i*y = |z|*exp{i*arg(z)}.
- It returns log(x+i*y) = log(|z|)+i*arg(z).
- The evaluation of |z| calls the square root routine,
- then a formula
- log(|z|) = (1/2)*log(x*x+y*y)
- is used.
- **************************************************/
- #ifndef SN_H
- #include "sn.h"
- #endif
- SComplex Clog(const SComplex& z){
- SDouble r = z.Norm(); // r = x*x+y*y
- if(r.Sign() == 0) r.SetError(r.DOMAIN_ERR, "Clog z=0", 9108);// z = 0
- r = Log(r)/2.0; // r = log |z|
- return SComplex(r, Arg(z));
- }
scfclog.cpp : last modifiled at 2015/06/22 15:15:56(629 bytes)
created at 2017/10/06 15:21:28
The creation time of this html file is 2017/10/06 15:27:09 (Fri Oct 06 15:27:09 2017).